import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
  build:{
    sourcemap:true
  },
  // 代理配置
  server: {
    host: '0.0.0.0',
    open: true,
    // 使用config文件
    proxy: {
      '/api': {
        target: 'http://localhost:9876/api', //接口地址
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      }
    }
  }
})
